package io.bear.common.exception;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * 框架异常
 */
@Data
public class BeerException extends RuntimeException {

    @ApiModelProperty(value = "响应编码")
    protected Integer code = 500;

    public BeerException() {
    }

    public BeerException(String message) {
        super(message);
    }

    public BeerException(String message, Throwable cause) {
        super(message, cause);
    }

    public BeerException(Throwable cause) {
        super(cause);
    }

    public BeerException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) {
        super(message, cause, enableSuppression, writableStackTrace);
    }

    public BeerException(String message, Integer code) {
        super(message);
        this.code = code;
    }

    public BeerException(String message, Throwable cause, Integer code) {
        super(message, cause);
        this.code = code;
    }

    public BeerException(Throwable cause, Integer code) {
        super(cause);
        this.code = code;
    }

    public BeerException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, Integer code) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.code = code;
    }

}
